package org.springblade.modules.repair.vo.statistics.ps;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @Description
 * @Author ysq
 * @Date 2023/6/28
 **/
@Data
public class PctItemVO {

	@ApiModelProperty(value = "值")
	private Long value;

	@ApiModelProperty(value = "百分比")
	private BigDecimal pct;

	public Long getValue() {
		if (this.value == null) {
			return 0L;
		}
		return value;
	}

	public BigDecimal getPct() {
		if (this.pct == null) {
			return BigDecimal.ZERO;
		}
		return pct.multiply(new BigDecimal(100)).setScale(1, BigDecimal.ROUND_HALF_UP);
	}
}
